Game_CharacterBase.prototype.isInTheScreen = function() {
    var gw = Graphics.width;
    var gh = Graphics.height;
    var tw = $gameMap.tileWidth();
    var th = $gameMap.tileHeight();
    var px = this.scrolledX() * tw + tw / 2 - gw / 2;
    var py = this.scrolledY() * th + th / 2 - gh / 2;
    return px >= -gw/2 && px <= gw/2 && py >= -gh/2 && py <= gh/2;
};

Game_CharacterBase.prototype.isNearTheScreenArea = function(aw,ah) {
    var gw = Graphics.width;
    var gh = Graphics.height;
    var tw = $gameMap.tileWidth();
    var th = $gameMap.tileHeight();
    var px = this.scrolledX() * tw + tw / 2 - gw / 2;
    var py = this.scrolledY() * th + th / 2 - gh / 2;
    return px >= (-gw/2-aw) && px <= (gw/2+aw) && py >= (-gh/2-ah) && py <= (gh/2+ah);
};